import React from 'react';
import './index.scss';
import { Link } from 'react-router-dom';
import { List } from 'antd-mobile';

const Item = List.Item;

class Nav extends React.Component {
    render() {
        return (
            <div className="nav">
                {
                    this.props.list.map((ele, idx) => (
                        <Link replace to={ele.url} key={idx}>
                            <List>
                                <Item>{ele.text}</Item>
                            </List>
                        </Link>
                    ))
                }
                {this.props.children}
                {this.props.customEl}
            </div>
        )
    }
}

export default Nav;
